$(function () {
    selectDianDao();
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;
        laydate.render({
            elem: '#begindate'
        });
        laydate.render({
            elem: '#enddate'
        });
        laydate.render({
            elem: '#begindatelate'
        });
        laydate.render({
            elem: '#enddatelate'
        });
    });
    selectAllData();
})
function selectDianDao() {
    let data = myAjax("/dianDao/dianDaoState","","post");
    data = data.list;
    let html = '<option value="">全部</option>';
    for (let i= 0; i<data.length;i++){
        html+='<option value="'+data[i].dianDaoState+'">'+data[i].dianDaoState+'</option>'
    }
    $("#modules").html(html);
}
function selectAllData() {
    let data1 = {
        personnelName: $("#personnelName").val(),
        dianDaoState: $("#modules").val(),
        begindate: $("#begindate").val(),
        enddate: $("#enddate").val(),
        begindatelate: $("#begindatelate").val(),
        enddatelate: $("#enddatelate").val(),
    }
    let data = myAjax("/dianDao/selectAllData",data1,"post");
    data = data.list;
    let html =''
    for (let i=0 ; i<data.length;i++){
        let chidaoTime = data[i].chidaoTime;
        if (chidaoTime==null){
            chidaoTime = '';
        }
        html +='<tr>\n' +
            '            <td>'+data[i].id+'</td>\n' +
            '            <td>'+data[i].personnelName+'</td>\n' +
            '            <td>'+data[i].dianDaoState+'</td>\n' +
            '            <td>'+chidaoTime+'</td>\n' +
            '            <td>'+data[i].diandaoTime+'</td>\n' +
            '        </tr>'
    }
    $("#diandaoAll").html(html);
}